package org.example.iris.mapper;

import org.apache.ibatis.annotations.*;
import org.example.iris.entity.File;


@Mapper
public interface ResumeFileMapper {

    @Select("select * from file where file_id = #{fileId}")
    File findById(Integer fileId);


    @Insert("insert into file(file_path, download_num) values(#{filePath}, 0)")
    @Options(useGeneratedKeys = true, keyProperty = "fileId")
    void insertFile(File file);

    @Update("update file set download_num = #{downloadNum} where file_id = #{fileId}")
    void update(File file);

    @Delete("delete from file where file_id = #{fileId}")
    void deleteFile(Integer fileId);
}
